package cn.com.dcsgo.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * 部门信息视图对象
 *
 * @author Dcsgo
 * @since 2/6/2025 下午 8:05
 */
@Schema(description = "部门信息视图对象")
@Data
public class SysDeptVO {
    /**
     * 部门id
     */
    @Schema(description = "部门编号")
    private Long deptId;

    /**
     * 父部门id
     */
    @Schema(description = "上级部门编号")
    private Long parentId;

    /**
     * 部门名称
     */
    @Schema(description = "部门名称")
    private String deptName;

    /**
     * 显示顺序
     */
    @Schema(description = "显示顺序")
    private Integer orderNum;

    /**
     * 负责人编号
     */
    @Schema(description = "负责人编号")
    private Long leaderId;

    /**
     * 负责人姓名
     */
    @Schema(description = "负责人姓名")
    private String leaderName;

    /**
     * 联系电话
     */
    @Schema(description = "联系电话")
    private String phone;

    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    private String email;

    /**
     * 状态（0正常 1停用）
     */
    @Schema(description = "状态（0正常 1停用）")
    private Integer status;

    /**
     * 创建者
     */
    @Schema(description = "创建者")
    private String createBy;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 更新者
     */
    @Schema(description = "更新者")
    private String updateBy;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private Date updateTime;

    /**
     * 下级部门
     * 叶子菜单在序列化时将不包含 children 属性
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @Schema(description = "下级部门")
    private List<SysDeptVO> children;

    public SysDeptVO() {
        this.children = new LinkedList<>();
    }
}

